using System;
using UnityEngine;

namespace EntityKit.Runtime
{
    /// <summary>
    /// 配置表基础类
    /// 所有配置表类都需要继承此类
    /// </summary>
    [Serializable]
    public class ConfigTableBase
    {
        /// <summary>
        /// 配置表唯一标识符
        /// </summary>
        public int ID { get; set; }
        
        /// <summary>
        /// 克隆当前配置项
        /// </summary>
        /// <returns>克隆的对象</returns>
        public virtual ConfigTableBase Clone()
        {
            try
            {
                return this.DeepCopy();
            }
            catch (Exception ex)
            {
                Debug.LogError($"Failed to clone config item: {ex.Message}");
                return null;
            }
        }
    }
}